package mlz.arr;

//数组的静态初始化方式
public class Demo01 {
    public static void main(String[] args) {
        //定义数组
        // 标准写法: 数据类型[] 变量名 = new 数据类型[]{元素1,元素2,元素3,....};
        int[] arr = new int[]{1,2,3,4,5};
        double[] arr1 = new double[]{3.14,2.33,5.0};
        System.out.println(arr);//[I@4eec7777  -> 地址值



        //简化写法: 数据类型[] 变量名 = {元素1,元素2,.....};
        int[] arr2 = {1,2,3,4,5,6};
        double[] arr3 = {3.14,3.3};

        //数组定义
        int arr4[] = {1,3,45};


    }
}
